<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<script type="text/javascript">
    var base = "${base}";
</script>
<link rel="stylesheet" href="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<style>
    #table2_1 th {
        background-color: #93DAFF;
        color: #000000
    }

</style>

<table id="login" style="text-align: center" class="table table-hover table-bordered">
    <thead class="thead-dark">
    <tr style="background: #93DAFF">
        <th >姓名</th>
        <th>学号</th>
        <th>性别</th>
        <th>出生日期</th>
        <th>政治面貌</th>
        <th>操作</th>
    </tr>
    </thead>
    <c:forEach items="${PageInfo.list }" var="p" varStatus="status">
        <tr>
            <th><a href="javascript:void (0)" onclick="showDetial(${p.id})"> ${p.name}</a></th>
            <th>${p.studentNumber}</th>

            <th><c:if test="${p.gender == 'MALE'}">男</c:if>
                <c:if test="${p.gender == 'FEMALE'}">女</c:if>
            </th>
            <th>${p.birthday}</th>
            <th>
                <c:if test="${p.polity == 'PARTYMEMBER'}">党员</c:if>
                <c:if test="${p.polity == 'MEMBER'}">团员</c:if>
                <c:if test="${p.polity == 'INDEPENDENTMEMBER'}">无党派</c:if>
                <c:if test="${p.polity == 'OTHER'}">其他</c:if>
            </th>
            <th>
                <button id="editStudent"
                        onclick="editStudent(${p.id})">修改
                </button>
                <button
                        id="deleteStudent" onclick="deleteStudent(${p.id})">删除
                </button>
            </th>
        </tr>
    </c:forEach>
</table>


<div style="text-align: center">
    <c:if test="${PageInfo.hasPreviousPage}">
        <a href="javascript:void(0)" onclick="go(1)">首页</a>
        <a href="javascript:void(0)" onclick="go(${PageInfo.pageNum-1})">上一页</a>
    </c:if>
    <span>${PageInfo.pageNum}/${PageInfo.pages}</span>
    <c:if test="${PageInfo.hasNextPage}">
        <a href="javascript:void(0)" onclick="go(${PageInfo.pageNum+1})">下一页</a>
        <a href="javascript:void(0)" onclick="go(${PageInfo.pages})">尾页</a>
    </c:if>
</div>
